From 7564231fbc9ce8dfe1ac42223cd20f3dbad15070 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Tue, 18 Mar 2008 11:32:06 +0000 Subject: [PATCH] xm: allow non-existent readline module Let xm work even if Python doesn't have its readline module installed. Signed-off-by: John Levon --- tools/python/xen/xm/main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/python/xen/xm/main.py b/tools/python/xen/xm/main.py index b4e7f1804b..eab8e47c63 100644 --- a/tools/python/xen/xm/main.py +++ b/tools/python/xen/xm/main.py @@ -626,8 +626,11 @@ class Shell(cmd.Cmd): def preloop(self): cmd.Cmd.preloop(self) - import readline - readline.set_completer_delims(' ') + try: + import readline + readline.set_completer_delims(' ') + except ImportError: + pass def default(self, line): words = shlex.split(line) -- 2.30.2